
import { config } from '../../../utils/config'


// pages/pointsMall/pointsDetail/pointsDetail.js
Page({

  /**
   * Page initial data
   */
  data: {
    imgUrl: config.imgUrl,
    entTime : '2020-07'
  },

  /**
   * Lifecycle function--Called when page load
   */
  onLoad: function (options) {
    
    this.getTime();
  },
  getTime(){

    var timestamp = Date.parse(new Date());
    var date = new Date(timestamp);
    //获取年份  
    var Y =date.getFullYear();
    //获取月份  
    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
    this.setData({
      year : Y,
      month : M
    })
  },

  bindDateChange: function(e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    let timeDay = e.detail.value;
    let [year, month] = timeDay.split('-')
    this.setData({
        year,
        month
    })
    // let user_token = wx.getStorageSync('token')
    // this.queryJifen(user_token, timeDay)
},

  /**
   * Lifecycle function--Called when page is initially rendered
   */
  onReady: function () {

  },

  /**
   * Lifecycle function--Called when page show
   */
  onShow: function () {

  },

  /**
   * Lifecycle function--Called when page hide
   */
  onHide: function () {

  },

  /**
   * Lifecycle function--Called when page unload
   */
  onUnload: function () {

  },

  /**
   * Page event handler function--Called when user drop down
   */
  onPullDownRefresh: function () {

  },

  /**
   * Called when page reach bottom
   */
  onReachBottom: function () {

  },

  /**
   * Called when user click on the top right corner to share
   */
  onShareAppMessage: function () {

  }
})